#include <iostream>
#include <zlib/net/I_UnixNet.h>
#include <unistd.h>

using namespace std;

int main()
{
	Connection conn;
	NetOptions opt;
	opt._family = AF_INET;
	opt._sock_type = SOCK_STREAM;
	opt._bind_addr = true;
	opt.fd_blocking = false;
	opt.fd_blocking_connect = false;
	opt.fd_blocking_connect = true;
	opt.local.init(AF_INET, "127.0.0.2", 0);
	int sockfd = conn.open(opt);
	cout << sockfd << endl;

	IpEntry server;
	server.init(AF_INET, "127.0.0.1", 8888);

	int er = conn.connect(&server, opt);
	cout << er << endl;

	sleep(1000);

	return 0;
}
